import request from '@/utils/request'

// 查询课题 列表
export function listTopic(query) {
  return request({
    url: '/research/topic/list',
    method: 'get',
    params: query
  })
}

// 查询课题 详细
export function getTopic(topicId) {
  return request({
    url: '/research/topic/' + topicId,
    method: 'get'
  })
}

// 新增课题
export function addTopic(data) {
  return request({
    url: '/research/topic',
    method: 'post',
    data: data
  })
}

// 修改课题
export function updateTopic(data) {
  return request({
    url: '/research/topic',
    method: 'put',
    data: data
  })
}

// 删除课题
export function delTopic(topicId) {
  return request({
    url: '/research/topic/' + topicId,
    method: 'delete'
  })
}

// 导出课题
export function exportTopic(query) {
  return request({
    url: '/research/topic/export',
    method: 'get',
    params: query
  })
}

// 设置成员
export function addMembers(data) {
  return request({
    url: '/research/topic/addMembers',
    method: 'post',
    data: data
  })
}

// 获取成员
export function getMembers(topicId) {
  return request({
    url: '/research/topic/getMembers/' + topicId,
    method: 'get'
  })
}

// 查询当前用户所在成员的所有课题 不分页
export function listAllTopic() {
  return request({
    url: '/research/topic/listAll',
    method: 'get'
  })
}

// 查询所有课程formJson
export function listAllAndFrom() {
  return request({
    url: '/research/topic/listAllAndFrom',
    method: 'get'
  })
}
